Imports Microsoft.VisualBasic
Imports System.Data
Public Class AUTHORITY
    Dim Conn As Connect         'Object Class Connect
    Dim dt As DataTable
    Public Function DoCheck(ByVal User_Id As String, ByVal Role_Prg As String)
        Conn = New Connect      'New Object Class Connect
        Dim SQL As String = "SELECT pty_mst_user_role.user_id, " & _
                            "pty_mst_user_role.role_id, " & _
                            "pty_mst_role_dtl.role_prg " & _
                            "FROM pty_mst_role " & _
                            "INNER JOIN pty_mst_role_dtl ON " & _
                            "PTY_MST_ROLE.role_id = PTY_MST_ROLE_DTL.role_id " & _
                            "INNER JOIN pty_mst_user_role ON " & _
                            "pty_mst_user_role.role_id = PTY_MST_ROLE.role_id " & _
                            "WHERE pty_mst_user_role.user_id='" & User_Id & "' " & _
                            "AND pty_mst_role_dtl.role_prg='" & Role_Prg & "'"
        dt = Conn.GetData(SQL)
        If dt.Rows.Count <> 0 Then
            Return 1
        Else
            Return 0
        End If
    End Function
End Class
